package Text;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class create_txt {
    public static String content = "";//先粘贴元素 <div class="rank-main clearfix"> *** </div>
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        String path = "src/main/resources/niu_number_txtfile/niu_" + num + "_txt";
        try {
            File file = new File(path);
            if (!file.exists()) {
                if (file.createNewFile()) {
                    System.out.println("File created: " + file.getName());
                } else {
                    System.out.println("Failed to create file.");
                }
            }

            FileWriter writer = new FileWriter(file);
            writer.write(content);
            writer.close();

            System.out.println("Successfully wrote to the file.");
        } catch (IOException e) {
            System.out.println("An error occurred.");
            e.printStackTrace();
        }
    }
}